package com.cqie;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

@SpringBootApplication
@MapperScan("com.cqie.mapper")
@Slf4j
public class IntelligentCloudDiagnosisApplication {

    public static void main(String[] args) throws UnknownHostException {

        ConfigurableApplicationContext application = SpringApplication.run(IntelligentCloudDiagnosisApplication.class
                , args);
        Environment env = application.getEnvironment();
        log.info("\n--------------------------------------------------------------\n\t" +
                        "应用程序： '{}' 正在运行! \n\t" +
                        "内部访问: \t\thttp://localhost:{}\n\t" +
                        "外部访问: \t\thttp://{}:{}\n\t" +
                        "swagger 文档: \thttp://{}:{}/swagger-ui/index.html\n" +
                        "-----------------------------启动成功-----------------------------",
                env.getProperty("spring.application.name"),
                env.getProperty("server.port"),
                InetAddress.getLocalHost().getHostAddress(),
                env.getProperty("server.port"),
                InetAddress.getLocalHost().getHostAddress(),
                env.getProperty("server.port"));

    }

}
